<h1>Contas</h1>

<div class="menubar">
	<%= link_to "Nova conta", new_conta_path %>
</div>

<%= flash_alerts %>

<% if @contas.empty? %>
	<%= bootstrap_alert do %>
		<p>Nenhuma conta cadastrada</p>
	<% end %>
<% end %>

<div class="row-fluid">
	<% if @contas.any? %>
		<table class="table table-striped">
			<thead>
				<tr>
					<th>Contas</th>
					<th>Saldo</th>
					<th>Situação</th>
				</tr>
			</thead>

			<tbody>
				<% @contas.each do |c| %>
					<tr>
						<td class="span5"><%= c.nome %></td>
						<td class="span2 text-center"><%= number_to_currency c.saldo %></td>
						<td class="span2 text-center"><%= c.ativa ? 'Ativa' : 'Inativa' %></td>
						<td class="span1">
							<%= show_link c %>
						</td>
						<td class="span1">
							<%= edit_link c %>
						</td>
						<td class="span1">
							<%= destroy_link c %>
						</td>
					</tr>
				<% end %>
			</tbody>
		</table>
	<% end %>	
</div>


